2<template>
	<div>
    <div id="check">
      <div class="check-container">
        <div  class="watermark"><img class="watermark-img" src="@/assets/img/watermark.jpg" /></div>
        <!-- <div  v-if="isCurrentVersion" class="watermark" ><img class="watermark-img" src="@/assets/img/watermark.jpg" width='77.5%'  style="margin-top: 410px;margin-left: 95px;" height='209%' /></div> -->
        <!-- <div class="watermark" ><img class="watermark-img" src="@/assets/img/watermark.jpg" width='77.5%'  style="margin-top: 410px;margin-left: 95px;" height='209%' /></div> -->
        <div class="content">
          <div style="height: 60px"></div>
          <div class="check-box">
            <div class="page-header1">
              <table border="1">
                <tr>
                	<td class="w-357 h-102">
                    <el-row>
                      <el-col :span="11" :offset="1">
                        <img src="@/assets/img/logoNew.png" style="height: 60px" />
                      </el-col>
                      <el-col :span="12">
                        <b style="font-size: 30px;line-height: 2;">成都倍特</b>
                      </el-col>
                    </el-row>
                  </td>
                  <td colspan="2" class="w-543 h-102 text-center" style="font-size: 21px">成品出厂放行审核单（受托生产）</td>
                </tr>
                <tr style="font-size: 19px;">
                	<td class="w-357 h-25"><div class="m-l-10">记录编号<span style="font-family: arial;padding-left: 1px">No ：ZL/SMP·059-R03</span></div></td>
                  <td class="w-237 h-25"><div class="m-l-10">版本号<span style="font-family: arial;padding-left: 1px">Version ：01</span></div></td>
                  <td class="w-306 h-25"><div class="m-l-10">页码<span style="font-family: arial;padding-left: 1px">Page ：3 / 3</span></div></td>
                </tr>
              </table>
              <div class="name-box">
                <div class="report-name">
                  <b>
                    成品出厂放行审核单（受托生产Ⅱ）
                  </b>
                </div>
              </div>
            </div>
            <div class="page-main" id="main-body">
              <table border="1">
                <tr>
                	<td class="w-100 h-50"><div class="text-center">品&nbsp;&nbsp;名</div></td>
                  <td class="w-350 h-50"><div class="text-center">{{ checkList.productName }}</div></td>
                  <td class="w-200 h-50"><div class="text-center">产品编码</div></td>
                  <td class="w-250 h-50"><div class="text-center">{{ checkList.productGmp }}</div></td>
                </tr>
                <tr>
                	<td class="w-100 h-50"><div class="text-center">批&nbsp;&nbsp;号</div></td>
                  <td class="w-350 h-50"><div class="text-center">{{ checkList.batchNum }}</div></td>
                  <td class="w-200 h-50"><div class="text-center">产成品量</div></td>
                  <td class="w-250 h-50"><div class="text-center point" @click="number2Filter">{{ zcList.productionQuantity + zcList.productionUnitName }}</div></td>
                </tr>
                <tr>
                	<td class="w-100 h-50"><div class="text-center">规&nbsp;&nbsp;格</div></td>
                  <td class="w-350 h-50"><div class="text-center"><span v-html="checkList.productSpec"></span></div></td>
                  <td class="w-200 h-50"><div class="text-center">生产日期</div></td>
                  <td class="w-250 h-50"><div class="text-center">{{ zcList.productionDate | changeTime }}</div></td>
                </tr>
                <tr>
                	<td class="w-100 h-50"><div class="text-center">包装规格</div></td>
                  <td class="w-350 h-50"><div class="text-center">{{ checkList.productPackSpec }}</div></td>
                  <td class="w-200 h-50"><div class="text-center">有效期至</div></td>
                  <td class="w-250 h-50"><div class="text-center">{{ zcList.validityDate | changeTime }}</div></td>
                </tr>
              </table>
              <div class="text-center" style="font-size: 23px;height: 60px;line-height: 60px;font-family: Times New Roman;letter-spacing: 0.2px;">
                <b>
                  QC
                  <span style="font-family: SimSun">部门/质量研究室审核</span>
                </b>
              </div>
              <table border="1">
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">审核项目</div></td>
                  <td colspan="3" class="w-585 h-50"><div class="text-center m-t-5">审核标准</div></td>
                  <td class="w-190 h-50"><div class="text-center m-t-5">审核结果</div></td>
                </tr>
                <tr>
                	<td class="w-125"><div class="text-center m-t-5">检验结果</div></td>
                  <td colspan="3" class="w-585"><div class="special-text-section">中间产品与成品有检验合格报告，检验项目齐全，检验结果符合内控标准规定，指标无异常偏离。</div></td>
                  <td class="w-190 m-t-5">
                    <div class="select-box m-l-10"></div>符合,
                    <div class="select-box"></div>不符合
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">检验记录</div></td>
                  <td colspan="3" class="w-585 h-50"><div class="special-text-section" style="line-height: 1.8;">批检验原始记录填写规范，请验单完备；检验结果准确，有复核人签字；原始数据的处理符合规定；检验原始图谱齐备，有检验人签名，原始数据图谱与记录数据一致；检验仪器与玻璃计量器具校验合格，且在效期内；试液、滴定液、标准品在效期内。</div></td>
                  <td class="w-190 h-50 m-t-5">
                    <div class="select-box m-l-10"></div>符合,
                    <div class="select-box"></div>不符合
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">留&nbsp;&nbsp;样</div></td>
                  <td colspan="3" class="w-585 h-50"><div class="special-text-section">产品按规定数量和贮存条件进行留样。</div></td>
                  <td class="w-190 h-50 m-t-5">
                    <div class="select-box m-l-10"></div>符合,
                    <div class="select-box"></div>不符合
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">验&nbsp;&nbsp;证</div></td>
                  <td colspan="3" class="w-585 h-50"><div class="special-text-section">关键检验仪器确认合格，必要的检验方法经过了验证。</div></td>
                  <td class="w-190 h-50 m-t-5">
                    <div class="select-box m-l-10"></div>符合,
                    <div class="select-box"></div>不符合
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">变&nbsp;&nbsp;更</div></td>
                  <td colspan="3" class="w-585 h-50">
                    <div class="special-text-section">
                      无<div class="select-box"></div>；
                      有<div class="select-box"></div>，已按规定程序处理，变更编号：
                    </div>
                  </td>
                  <td class="w-190 h-50 m-t-5">
                    <div class="select-box m-l-10"></div>符合,
                    <div class="select-box"></div>不符合
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">偏&nbsp;&nbsp;差</div></td>
                  <td colspan="3" class="w-585 h-50">
                    <div class="special-text-section">
                      无<div class="select-box"></div>；
                      有<div class="select-box"></div>，已按规定程序处理，偏差编号：
                    </div>
                  </td>
                  <td class="w-190 h-50 m-t-5">
                    <div class="select-box m-l-10"></div>符合,
                    <div class="select-box"></div>不符合
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5"><b>结&nbsp;&nbsp;论</b></div></td>
                  <td colspan="4" class="h-50" style="font-size: 22px;">
                    <div class="m-l-143 m-t-5">
                      <div class="select-box-b"></div><b>符合要求；</b>
                      <div class="select-box-b m-l-95"></div><b>不符合要求</b>
                    </div>
                  </td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">审 核 人</div></td>
                  <td class="w-365 h-50"></td>
                  <td class="w-125 h-50"><div class="text-center m-t-5">日&nbsp;&nbsp;期</div></td>
                  <td colspan="2" class="h-50"></td>
                </tr>
                <tr>
                	<td class="w-125 h-50"><div class="text-center m-t-5">备&nbsp;&nbsp;注</div></td>
                  <td colspan="4" class="h-50" style="font-size: 22px;"></td>
                </tr>
              </table>

              <div style="position: absolute;bottom: 122px;">
                <div style="padding-left: 700px">
                  <span style="font-family: arial">2021.05.24</span> 生效
                </div>
              </div>
              <div class="page-foot text-center">
                <div class="copyright-box">
                  <div style="font-family: arial">
                    This document is strictly confidential.Any use and copy unauthorized by CHENGDU BRILLIANT PHARMACEUTICAL <b><i>is forbidden.</i></b>
                  </div>
                  <div>
                    本文件仅限成都倍特药业股份有限公司内部使用，严禁任何无授权使用、泄露或复印，违者必究。
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
	</div>
</template>

<script>
  import {
    getCheckInfo,
    getCurrentVersion
  } from '@/api/check'
  import { CODE_OK } from '@/common/js/config'
  import { isBlank,parseTime } from '@/common/js/utils'
	export default {
    data() {
      return {
        isCurrentVersion: false,
        visible: false,
        checkList: {},
        zcList: {}
      }
    },
    props: ["childDataForm"],
    created() {
      if (!isBlank(this.childDataForm)) {
        this.checkList = this.childDataForm
        this.getData()
        this.visible = true
      }
    },
    methods: {
      number2Filter() {
        let number = this.zcList.productionQuantity
        if (isBlank(number)) return
        number = number + ''
        //如果不带小数点，则加上 '.0'
        if (number.indexOf('.') == -1) {
          number = number + '.0'
        }else{
          //如果带小数点,则加0,不允许超过4位
          number = number + '0'
          //如果最后5位为'00000'，则重置
          if (number.substring(number.length - 5) == '00000') {
            number = number.substring(0,number.length - 5)
            if (number.substring(number.length - 1) == '.') {
              number = number.substring(0,number.length - 1)
            }
          }
        }
        this.zcList.productionQuantity = number
      },
      getData() {
        const params = {
          content: 'zc',
          checkMergeId: this.checkList.checkMergeId
        }
        getCheckInfo(params).then(res => {
          if (res.code === CODE_OK) {
          	this.zcList = res.info.zcList
            this.checkList = res.info.list
            // 如果是 硫酸阿米卡星   硫酸卡那霉素   去乙酰毛花苷 ，那么提醒修改产成品量小数点
            if (this.checkList.productGmp == 'H02A' || this.checkList.productGmp == 'H01A' || this.checkList.productGmp == 'Q01A') {
              this.$alert('请注意修改产成品量的小数点哟', '警告', {
                confirmButtonText: '知道了',
                callback: action => {}
              })
            }
          }else{
          	this.$message.error(res.msg)
          }
        })
        const params2 = {
          checkTypeId: this.checkList.checkTypeId,
          printClassify: '成品出厂放行审核单（受托生产）'
        }
        getCurrentVersion(params2).then(res => {
          if (res.code === CODE_OK) {
            this.isCurrentVersion = (res.version.recordNum + '-' + res.version.versionNum) == this.checkList.printPassNumber
          }else{
          	this.$message.error(res.msg)
          }
        })
      },
      close() {
        this.visible = false
        this.$emit('close')
      }
    }
	}
</script>

<style type="text/scss" lang="scss" scoped>
  .check-container{
    color: black;
    background-color: #fff;
    font-family: SimSun;
    font-size: 19px;
    letter-spacing: 0.1px;
    width: 960px;
    height: 1480px;
    padding: 15px;
    .watermark{
      position: absolute;
      margin-top: 250px;
      .watermark-img{
        width: 960px;
      }
    }
    .content{
      position: relative;
      .check-box{
        width: 900px;
        height: 1375px;
        margin: 0 15px;
        .page-header1{
          height: 190px;
          .name-box{
            height: 100px;
            .report-name{
              text-align: center;
              letter-spacing: 0.2px;
              font-size: 25px;
              line-height: 100px;
            }
          }
        }
        .page-main{
          margin-top: 40px;
          .first-col{
            border-top:0;
            border-right:0;
            border-bottom:0;
            border-left:0;
          }
          .one-col{
            border-top:0;
            border-right:0;
            border-bottom:0;
            border-left:1px solid black;
          }
        }
        .page-foot{
          border-top: 2px solid black;
          font-size: 13px;
          width: 900px;
          bottom: 25px;
          position: absolute;
          height: 40px;
          .copyright-box{
            width: 100%;
            bottom: 0;
            position: absolute;
          }
        }
      }
    }
    .select-box{
      display: inline-block;
      width: 15px;
      height: 15px;
      border: 1px solid black;
    }
    .select-box-b{
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid black;
    }
    .w-95{
      width: 95px;
    }
    .w-100{
      width: 100px;
    }
    .w-125{
      width: 125px;
    }
    .w-190{
      width: 190px;
    }
    .w-200{
      width: 200px;
    }
    .w-237{
      width: 237px;
    }
    .w-250{
      width: 250px;
    }
    .w-306{
      width: 306px;
    }
    .w-350{
      width: 350px;
    }
    .w-357{
      width: 357px;
    }
    .w-365{
      width: 365px;
    }
    .w-585{
      width: 585px;
    }
    .h-102{
      height: 102px;
    }
    .h-25{
      height: 25px;
    }
    .h-50{
      height: 50px;
    }
    .p-l-50{
      padding-left: 50px;
    }
    .m-l-5{
      margin-left: 5px;
    }
    .m-l-10{
      margin-left: 10px;
    }
    .m-l-95{
      margin-left: 95px;
    }
    .m-l-143{
      margin-left: 143px;
    }
    .m-t-5{
      margin-top: 5px;
    }
    .special-text-section{
      margin-left: 5px;
      line-height: 1.55;
      margin-top: 10px;
      margin-bottom: 5px;
    }
  }
</style>
